/**
 * Created with hong.rong
 * Description:错误捕捉
 * Date:2020/06/21
 */

import { notification } from 'antd'

export default {
  onError(e, ...args) {
    e.preventDefault()
    const msg = (e.data && e.data.message) || e.message
    notification.config({
      placement: 'topRight',
    })
    if (msg) {
      notification.error({
        message: '提示',
        description: msg,
      })
    }
  },
}
